from eden.evo.codon import Codon

class Chromosome:
    def __init__(self, codons):
        self.__codons = codons if isinstance(codons, tuple) else tuple(codons)
        
    @staticmethod
    def create_null_chromosome(len):
        codons = tuple(Codon(0, 128, 0) for i in range(len)) #@UnusedVariable
        return Chromosome(codons)
        
    def __len__(self):
        return len(self.__codons)
    
    def __iter__(self):
        for codon in self.__codons:
            yield codon
    
    def __getitem__(self, index):
        return self.__codons[index]
    
